package org.example.Single;


//饿汉式单例，采用静态代码块，类加载时就执行，线程安全
public class Singleton02 {
    private  Singleton02(){};

    private static Singleton02 singleton02;

    static {
        singleton02 = new Singleton02();
    }

    public static Singleton02 getSingleton02(){
        return singleton02;
    }
}
